<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/base/segment/resourceHeader.jsp" %>
<%@ page import="com.newray.base.model.TUserinfo" %>

<body class="easyui-layout">
	<div region="north" border="false" style="height:60px;background:#B3DFDA;padding:10px">north region</div>
	<div region="west" split="true" title="West" style="width:150px;padding:10px;">west content</div>
	<div region="east" split="true" collapsed="true" title="East" style="width:100px;padding:10px;">east region</div>
	<div region="south" border="false" style="height:50px;background:#A9FACD;padding:10px;">south region</div>
	<div region="center" title="Main Title">
		<table id="_list_data_region"></table>
	</div>
</body>

<script>
	

	$(document).ready(function(){
		
		//变化部分
		//冻结域
		var fc = [[
               {field:'ck',checkbox:true},
               {title:'id',field:'id',width:180,sortable:true}
			]];
	
		//非冻结域
		var cols = [[
					{field:'address',title:'Address',width:220,sortable:true,
						sorter:function(a,b){
							return (a>b?1:-1);
						}
					},
					{field:'col4',title:'Col41',width:150},
					{field:'col4',title:'Col41',width:150},
					{field:'col4',title:'Col41',width:150},
					{field:'col4',title:'Col41',width:150},
					{field:'col4',title:'Col41',width:150}
				]];
		
		//功能按钮组
		var tb = [{
			id:'btnadd',
			text:'Add',
			iconCls:'icon-add',
			handler:function(){
				alert('add');
			}
		},{
			id:'btncut',
			text:'Cut',
			iconCls:'icon-cut',
			handler:function(){
				alert('cut');
			}
		},'-',{
			id:'btnsave',
			text:'Save',
			disabled:true,
			iconCls:'icon-save',
			handler:function(){
				alert('save');
			}
		}];
		
		$('#_list_data_region').datagrid({
			title:'My DataGrid',
			iconCls:'icon-save',
			width:1000,
			height:650,
			nowrap: false,
			singleSelect: true,
			striped: true,
			collapsible:true,
			url:'${pageContext.request.contextPath}/list/commonQuery.json?daoBeanID=userDao',
			sortName: 'id',
			sortOrder: 'desc',
			remoteSort: false,
			idField:'id',
			frozenColumns:fc,
			columns:cols,
			pagination:true,
			rownumbers:true,
			toolbar:tb,
		});
		
		var pager = $('#_list_data_region').datagrid('getPager');
		$(pager).pagination({
	        beforePageText: '第',//页数文本框前显示的汉字  
	        afterPageText: '页    共 {pages} 页',  
	        displayMsg: '当前显示 {from} - {to} 条记录   共 {total} 条记录', 
		});
	});
</script>
</html>
